using ASP;
using HoWave.Common;
using HoWave.Web;
using HoWave.Web.Shop;
using System;
using System.Data;
using System.Web;
using System.Web.Profile;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
public class Store_Edit_module : Shop, IRequiresSessionState
{
	protected int ShopID = 0;
	public string ShopLogoPath = "";
	protected TextBox AgreeBox;
	protected Button ButOK;
	protected Panel PanelAgree;
	protected FileUpload FileUpload1;
	protected Button UploadSave;
	protected Panel PanelUploadLogo;
	protected PlaceHolder Shoplogo;
	protected FileUpload FileBackground;
	protected HtmlInputCheckBox J_iShowDlogo;
	protected HtmlInputCheckBox J_iShowDtitle;
	protected HtmlInputCheckBox J_iShowBg;
	protected HiddenField HiBackground;
	protected Button ButBackground;
	protected PlaceHolder SetBackgroundImage;
	protected HtmlInputText CusTitle;
	protected TextBox ProductDescripe;
	protected Button ButCus;
	protected HtmlInputHidden hiddenJust;
	protected PlaceHolder setCustomizeComment;
	protected HtmlSelect SelectElitePic;
	protected HtmlSelect SelectEliteNum;
	protected HtmlSelect SelectEliteOrderBy;
	protected PlaceHolder EliteShopProduct;
	protected HtmlInputText PLModuleName;
	protected HtmlInputText ProductKeyword;
	protected HtmlSelect PLSelectClass;
	protected HtmlInputRadioButton rdUnlimited;
	protected HtmlInputRadioButton rdoNew;
	protected HtmlInputRadioButton rdoOld;
	protected HtmlInputText PListprice1;
	protected HtmlInputText PListprice2;
	protected HtmlSelect picSize;
	protected HtmlSelect itemNum;
	protected HtmlSelect orderType;
	protected PlaceHolder ShopProductList;
	protected Button Button3;
	protected Literal PopularSearch;
	protected PlaceHolder PHShopSearch;
	protected HtmlInputText RankModuleName;
	protected HtmlSelect RankSelectClass;
	protected HtmlSelect displayCount;
	protected HtmlInputText RankPriceRange1;
	protected HtmlInputText RankPriceRange2;
	protected HtmlSelect displayContent;
	protected PlaceHolder ShopRank;
	protected TextBox UserNameBox;
	protected Button AddLinks;
	protected Label lbError;
	protected Repeater Repeater1;
	protected PlaceHolder Friendlinks;
	protected PlaceHolder ShopSlider;
	protected HtmlSelect selectOrderBy;
	protected HtmlSelect selectThreadNum;
	protected PlaceHolder EditExchangeArea;
	protected PlaceHolder SuccessIssue;
	protected HiddenField HiddenShopID;
	protected HtmlForm form1;
	protected DefaultProfile Profile
	{
		get
		{
			return (DefaultProfile)this.Context.Profile;
		}
	}
	protected global_asax ApplicationInstance
	{
		get
		{
			return (global_asax)this.Context.ApplicationInstance;
		}
	}
	protected void Page_Load(object sender, EventArgs e)
	{
		try
		{
			this.ShopID = int.Parse(base.Request.QueryString["ShopID"]);
			this.HiddenShopID.Value = this.ShopID.ToString();
		}
		catch (Exception ex)
		{
			ex.WriteErrorLog(new string[]
			{
				"正常操作"
			});
			this.ShopID = 0;
		}
		if (this.ShopID == 0)
		{
			base.ClientScript.RegisterClientScriptBlock(typeof(Page), "", "<script>alert('编辑出错，请联系管理员！')</script>");
		}
		else
		{
			string text = base.Request.QueryString["Column"];
			string text2 = text;
			switch (text2)
			{
			case "logo":
				this.Shoplogo.Visible = true;
				break;
			case "Background":
				this.SetBackgroundImage.Visible = true;
				this.HiBackground.Value = "Background";
				break;
			case "Recommend":
				this.EliteShopProduct.Visible = true;
				break;
			case "ProductList":
				this.ShopProductList.Visible = true;
				break;
			case "ShopSlider":
				this.ShopSlider.Visible = true;
				break;
			case "Shopbbs":
				this.EditExchangeArea.Visible = true;
				break;
			case "ShopSearch":
				this.PHShopSearch.Visible = true;
				break;
			case "ShopRank":
				this.ShopRank.Visible = true;
				break;
			case "links":
				this.Friendlinks.Visible = true;
				break;
			case "IssueOK":
				this.SuccessIssue.Visible = true;
				break;
			case "TopCus":
				this.setCustomizeComment.Visible = true;
				this.hiddenJust.Value = "1";
				break;
			case "LeftCus":
				this.setCustomizeComment.Visible = true;
				this.hiddenJust.Value = "2";
				break;
			case "RightCus":
				this.setCustomizeComment.Visible = true;
				this.hiddenJust.Value = "3";
				break;
			}
			this.ShowShopInfo();
			this.BindFriendLinks();
			if (!base.IsPostBack)
			{
				this.RankSorting(this.ShopID);
				this.InitEliteShopProduct(this.ShopID);
				this.InitEditExchangeArea(this.ShopID);
				this.InitProductList(this.ShopID);
			}
		}
	}
	protected void ButOK_Click(object sender, EventArgs e)
	{
		this.PanelAgree.Visible = false;
		this.PanelUploadLogo.Visible = true;
	}
	protected void UploadSave_Click(object sender, EventArgs e)
	{
		bool flag = true;
		int num = 0;
		UpLoadFile upLoadFile = new UpLoadFile();
		string text = upLoadFile.UploadShopPrc(this.FileUpload1, "/UpLoadFile/ShopLogo/", this.ShopID, 1);
		string text2 = text;
		if (text2 != null)
		{
			if (!(text2 == "1"))
			{
				if (!(text2 == "2"))
				{
					if (text2 == "3")
					{
						flag = false;
						base.ClientScript.RegisterClientScriptBlock(typeof(Page), "", "<script>alert('文件路径不能为空！')</script>");
					}
				}
				else
				{
					flag = false;
					base.ClientScript.RegisterClientScriptBlock(typeof(Page), "", "<script>alert('上传的图片格式错误！')</script>");
				}
			}
			else
			{
				flag = false;
				base.ClientScript.RegisterClientScriptBlock(typeof(Page), "", "<script>alert('上传的图片不能大于230 * 70px！')</script>");
			}
		}
		if (flag)
		{
			try
			{
				num = this.conn.Execute(string.Concat(new object[]
				{
					"update HLShop_Shop set logoPath='",
					text,
					"' where ShopID=",
					this.ShopID
				}));
			}
			catch (Exception ex)
			{
				ex.WriteErrorLog(new string[]
				{
					"正常操作"
				});
				num = 0;
			}
		}
		if (num > 0)
		{
			base.Response.Redirect("Edit_module.aspx?ShopID=" + this.ShopID + "&SuccessColse=Yes");
		}
	}
	protected void ButBackground_Click(object sender, EventArgs e)
	{
		bool flag = true;
		int num = 0;
		string text = "";
		string text2 = "";
		string sql = "";
		if (this.J_iShowDlogo.Checked)
		{
			text = "1,";
		}
		if (this.J_iShowDtitle.Checked)
		{
			text += "2,";
		}
		if (!this.J_iShowDlogo.Checked && !this.J_iShowDtitle.Checked)
		{
			text = "3,";
		}
		if (this.FileBackground.HasFile && this.FileBackground.FileName != "")
		{
			UpLoadFile upLoadFile = new UpLoadFile();
			text2 = upLoadFile.UploadShopPrc(this.FileBackground, "/UpLoadFile/ShopBackground/", this.ShopID, 2);
			string text3 = text2;
			if (text3 != null)
			{
				if (!(text3 == "1"))
				{
					if (!(text3 == "2"))
					{
						if (text3 == "3")
						{
							flag = false;
							base.ClientScript.RegisterClientScriptBlock(typeof(Page), "", "<script>alert('文件路径不能为空！')</script>");
						}
					}
					else
					{
						flag = false;
						base.ClientScript.RegisterClientScriptBlock(typeof(Page), "", "<script>alert('上传的图片格式错误！')</script>");
					}
				}
				else
				{
					flag = false;
					base.ClientScript.RegisterClientScriptBlock(typeof(Page), "", "<script>alert('上传的图片不能大于950 * 150px！')</script>");
				}
			}
		}
		if (this.FileBackground.HasFile && this.FileBackground.FileName != "")
		{
			if (flag)
			{
				sql = string.Concat(new object[]
				{
					"Update HLShop_Shop set BackgroundImage='",
					text2,
					"',ShowType='",
					text,
					"' where ShopID=",
					this.ShopID
				});
			}
		}
		else
		{
			sql = string.Concat(new object[]
			{
				"Update HLShop_Shop set ShowType='",
				text,
				"' where ShopID=",
				this.ShopID
			});
		}
		try
		{
			num = this.conn.Execute(sql);
		}
		catch (Exception ex)
		{
			ex.WriteErrorLog(new string[]
			{
				"正常操作"
			});
			num = 0;
		}
		if (num > 0)
		{
			base.Response.Redirect("Edit_module.aspx?ShopID=" + this.ShopID + "&SuccessColse=Yes");
		}
	}
	public void ShowShopInfo()
	{
		DataTable dataTable = this.conn.GetDataTable("select * from HLShop_Shop where ShopID=" + this.ShopID);
		if (dataTable != null && dataTable.Rows.Count > 0)
		{
			this.ShopLogoPath = dataTable.Rows[0]["logoPath"].ToString();
		}
		dataTable.Dispose();
	}
	public void BindFriendLinks()
	{
		this.Repeater1.DataSource = this.conn.GetDataTable("select * from HLShop_FriendLink as a,HLShop_Shop as b where a.FriendUserId=b.ShopOwnerID and a.ShopID=" + this.ShopID);
		this.Repeater1.DataBind();
	}
	protected void ButCus_Click(object sender, EventArgs e)
	{
		int num = 0;
		string value = this.hiddenJust.Value;
		string sql = "";
		string text = value;
		if (text != null)
		{
			if (!(text == "1"))
			{
				if (!(text == "2"))
				{
					if (text == "3")
					{
						sql = string.Concat(new object[]
						{
							"Update HLMall_StoreModule set CustomizeComment='",
							this.ProductDescripe.Text,
							"', ModuleName='",
							this.CusTitle.Value,
							"' where ModuleID=10 and ShopID=",
							this.ShopID
						});
					}
				}
				else
				{
					sql = string.Concat(new object[]
					{
						"Update HLMall_StoreModule set CustomizeComment='",
						this.ProductDescripe.Text,
						"', ModuleName='",
						this.CusTitle.Value,
						"' where ModuleID=9 and ShopID=",
						this.ShopID
					});
				}
			}
			else
			{
				sql = string.Concat(new object[]
				{
					"Update HLMall_StoreModule set CustomizeComment='",
					this.ProductDescripe.Text,
					"', ModuleName='",
					this.CusTitle.Value,
					"' where ModuleID=8 and ShopID=",
					this.ShopID
				});
			}
		}
		try
		{
			num = this.conn.Execute(sql);
		}
		catch (Exception ex)
		{
			ex.WriteErrorLog(new string[0]);
			num = 0;
		}
		if (num > 0)
		{
			base.Response.Redirect("Edit_module.aspx?ShopID=" + this.ShopID + "&SuccessColse=Yes");
		}
		else
		{
			base.Response.Write("<script>alert('自定义内容过多或格式不对！')</script>");
		}
	}
	protected void AddLinks_Click(object sender, EventArgs e)
	{
		string text = "";
		if (this.UserNameBox.Text == "")
		{
			this.lbError.Text = "添加链接不能为空！";
		}
		else
		{
			DataTable dataTable = this.conn.GetDataTable("select * from HL_User as a,HLShop_Shop as b where a.UserID=b.ShopOwnerID and a.UserName='" + this.UserNameBox.Text + "'");
			if (dataTable != null && dataTable.Rows.Count > 0)
			{
				int num = int.Parse(dataTable.Rows[0]["UserID"].ToString());
				int num2 = int.Parse(dataTable.Rows[0]["ShopID"].ToString());
				string text2 = dataTable.Rows[0]["ShopName"].ToString();
				if (!string.IsNullOrEmpty(text2))
				{
					text = "店铺的名称为：" + text2 + "。";
				}
				if (num2 > 0)
				{
					if (num2 == this.ShopID)
					{
						this.lbError.Text = text + "是当前装修店铺。";
						return;
					}
				}
				dataTable.Dispose();
				if (this.conn.ExecuteCount("select count(*) from HLShop_FriendLink where FriendUserId=" + num) > 0)
				{
					this.lbError.Text = "该用户链接已存在！" + text;
				}
				else
				{
					try
					{
						this.conn.Execute(string.Concat(new object[]
						{
							"insert into HLShop_FriendLink(ShopID,ByShopID,FriendUserId) values(",
							this.ShopID,
							",",
							num2,
							",",
							num,
							")"
						}));
					}
					catch (Exception ex)
					{
						ex.WriteErrorLog(new string[]
						{
							"正常操作"
						});
						this.lbError.Text = "添加失败！";
						return;
					}
					this.BindFriendLinks();
				}
			}
			else
			{
				this.lbError.Text = "该用户不存在或用户未开店！";
			}
		}
	}
	protected void Dellbt_Click(object sender, EventArgs e)
	{
		LinkButton linkButton = sender as LinkButton;
		RepeaterItem repeaterItem = linkButton.Parent as RepeaterItem;
		HiddenField hiddenField = (HiddenField)repeaterItem.FindControl("HiddenUserID");
		try
		{
			this.conn.Execute("delete HLShop_FriendLink where FriendUserID=" + int.Parse(hiddenField.Value));
		}
		catch (Exception ex)
		{
			ex.WriteErrorLog(new string[]
			{
				"正常操作"
			});
			this.lbError.Text = "删除失败！";
			return;
		}
		this.BindFriendLinks();
	}
	protected void Button3_Click(object sender, EventArgs e)
	{
		base.Response.Write("<script>alert('" + SetGetCookies.Get("PLModuleName").Value + "')</script>");
	}
	public void BindKeywords()
	{
		if (SetGetCookies.Get("Keyword") != null)
		{
			string text = HttpUtility.UrlDecode(SetGetCookies.Get("Keyword").Value);
			string text2 = "<table id='showKeyWord'>";
			if (text != "")
			{
				string[] array = text.Split(new char[]
				{
					','
				});
				for (int i = 0; i < array.Length; i++)
				{
					if (!string.IsNullOrEmpty(array[i]) || array[i] != "")
					{
						object obj = text2;
						text2 = string.Concat(new object[]
						{
							obj,
							"<tr><td>",
							array[i],
							"&nbsp;&nbsp;<a href='#' class='btn-del J_Del' onclick='delshowRows(",
							i,
							")'>删除</a></td></tr>"
						});
					}
				}
				this.PopularSearch.Text = text2;
			}
			text2 += "</table>";
		}
	}
	public void RankSorting(int ShopID)
	{
		DataTable dataTable = this.conn.GetDataTable("select * from HLMall_StoreModule where ModuleID=1 and ShopID=" + ShopID);
		if (dataTable != null && dataTable.Rows.Count > 0)
		{
			if (dataTable.Rows[0]["ModuleName"] != DBNull.Value)
			{
				this.RankModuleName.Value = dataTable.Rows[0]["ModuleName"].ToString();
			}
			if (dataTable.Rows[0]["ClassID"] != DBNull.Value)
			{
				if (dataTable.Rows[0]["ClassID"].ToString() == "-1")
				{
					this.RankSelectClass.Items[0].Selected = true;
				}
			}
			if (dataTable.Rows[0]["ShowProductNum"] != DBNull.Value)
			{
				if (dataTable.Rows[0]["ShowProductNum"].ToString() == "3")
				{
					this.displayCount.Items[0].Selected = true;
					this.displayCount.Items[5].Selected = false;
				}
				else
				{
					if (dataTable.Rows[0]["ShowProductNum"].ToString() == "4")
					{
						this.displayCount.Items[1].Selected = true;
						this.displayCount.Items[5].Selected = false;
					}
					else
					{
						if (dataTable.Rows[0]["ShowProductNum"].ToString() == "5")
						{
							this.displayCount.Items[2].Selected = true;
							this.displayCount.Items[5].Selected = false;
						}
						else
						{
							if (dataTable.Rows[0]["ShowProductNum"].ToString() == "6")
							{
								this.displayCount.Items[3].Selected = true;
								this.displayCount.Items[5].Selected = false;
							}
							else
							{
								if (dataTable.Rows[0]["ShowProductNum"].ToString() == "8")
								{
									this.displayCount.Items[4].Selected = true;
									this.displayCount.Items[5].Selected = false;
								}
								else
								{
									if (dataTable.Rows[0]["ShowProductNum"].ToString() == "10")
									{
										this.displayCount.Items[5].Selected = true;
									}
								}
							}
						}
					}
				}
			}
			if (dataTable.Rows[0]["Pricerange1"] != DBNull.Value)
			{
				this.RankPriceRange1.Value = dataTable.Rows[0]["Pricerange1"].ToString();
			}
			if (dataTable.Rows[0]["Pricerange2"] != DBNull.Value)
			{
				this.RankPriceRange2.Value = dataTable.Rows[0]["Pricerange2"].ToString();
			}
			if (dataTable.Rows[0]["ShowType"] != DBNull.Value)
			{
				if (dataTable.Rows[0]["ShowType"].ToString() == "topSelling")
				{
					this.displayContent.Items[0].Selected = true;
				}
				else
				{
					if (dataTable.Rows[0]["ShowType"].ToString() == "topCollect")
					{
						this.displayContent.Items[1].Selected = true;
						this.displayContent.Items[0].Selected = false;
					}
				}
			}
		}
	}
	public void InitEliteShopProduct(int ShopID)
	{
		DataTable dataTable = this.conn.GetDataTable("select * from HLMall_StoreModule where ModuleID=5 and ShopID=" + ShopID);
		if (dataTable != null && dataTable.Rows.Count > 0)
		{
			if (dataTable.Rows[0]["Picturesize"] != DBNull.Value)
			{
				string a = dataTable.Rows[0]["Picturesize"].ToString();
				if (a == "120")
				{
					this.SelectElitePic.Items[0].Selected = true;
				}
				else
				{
					if (a == "160")
					{
						this.SelectElitePic.Items[1].Selected = true;
						this.SelectElitePic.Items[0].Selected = false;
					}
					else
					{
						if (a == "220")
						{
							this.SelectElitePic.Items[2].Selected = true;
							this.SelectElitePic.Items[0].Selected = false;
						}
					}
				}
			}
			if (dataTable.Rows[0]["ShowProductNum"] != DBNull.Value)
			{
				string a2 = dataTable.Rows[0]["ShowProductNum"].ToString();
				if (a2 == "3")
				{
					this.SelectEliteNum.Items[0].Selected = true;
					this.SelectEliteNum.Items[1].Selected = false;
				}
				else
				{
					if (a2 == "4")
					{
						this.SelectEliteNum.Items[1].Selected = true;
					}
					else
					{
						if (a2 == "6")
						{
							this.SelectEliteNum.Items[2].Selected = true;
							this.SelectEliteNum.Items[1].Selected = false;
						}
						else
						{
							if (a2 == "8")
							{
								this.SelectEliteNum.Items[3].Selected = true;
								this.SelectEliteNum.Items[1].Selected = false;
							}
							else
							{
								if (a2 == "10")
								{
									this.SelectEliteNum.Items[4].Selected = true;
									this.SelectEliteNum.Items[1].Selected = false;
								}
								else
								{
									if (a2 == "12")
									{
										this.SelectEliteNum.Items[5].Selected = true;
										this.SelectEliteNum.Items[1].Selected = false;
									}
									else
									{
										if (a2 == "16")
										{
											this.SelectEliteNum.Items[6].Selected = true;
											this.SelectEliteNum.Items[1].Selected = false;
										}
									}
								}
							}
						}
					}
				}
			}
			if (dataTable.Rows[0]["Sortingway"] != DBNull.Value)
			{
				string a3 = dataTable.Rows[0]["Sortingway"].ToString();
				if (a3 == "NewOn")
				{
					this.SelectEliteOrderBy.Items[0].Selected = true;
				}
				else
				{
					if (a3 == "Lowprice")
					{
						this.SelectEliteOrderBy.Items[1].Selected = true;
						this.SelectEliteOrderBy.Items[0].Selected = false;
					}
					else
					{
						if (a3 == "Hightprice")
						{
							this.SelectEliteOrderBy.Items[2].Selected = true;
							this.SelectEliteOrderBy.Items[0].Selected = false;
						}
					}
				}
			}
		}
	}
	public void InitEditExchangeArea(int ShopID)
	{
		DataTable dataTable = this.conn.GetDataTable("select * from HLMall_StoreModule where ModuleID=6 and ShopID=" + ShopID);
		if (dataTable != null && dataTable.Rows.Count > 0)
		{
			if (dataTable.Rows[0]["PostsShowType"] != DBNull.Value)
			{
				string a = dataTable.Rows[0]["PostsShowType"].ToString();
				if (a == "1")
				{
					this.selectOrderBy.Items[0].Selected = true;
				}
				else
				{
					if (a == "2")
					{
						this.selectOrderBy.Items[1].Selected = true;
						this.selectOrderBy.Items[0].Selected = false;
					}
					else
					{
						if (a == "3")
						{
							this.selectOrderBy.Items[2].Selected = true;
							this.selectOrderBy.Items[0].Selected = false;
						}
						else
						{
							if (a == "4")
							{
								this.selectOrderBy.Items[3].Selected = true;
								this.selectOrderBy.Items[0].Selected = false;
							}
						}
					}
				}
			}
			if (dataTable.Rows[0]["ShowPostsNum"] != DBNull.Value)
			{
				string a2 = dataTable.Rows[0]["ShowPostsNum"].ToString();
				if (a2 == "0")
				{
					this.selectThreadNum.Items[0].Selected = true;
				}
				else
				{
					if (a2 == "3")
					{
						this.selectThreadNum.Items[1].Selected = true;
						this.selectThreadNum.Items[0].Selected = false;
					}
					else
					{
						if (a2 == "4")
						{
							this.selectThreadNum.Items[2].Selected = true;
							this.selectThreadNum.Items[0].Selected = false;
						}
						else
						{
							if (a2 == "5")
							{
								this.selectThreadNum.Items[3].Selected = true;
								this.selectThreadNum.Items[0].Selected = false;
							}
							else
							{
								if (a2 == "6")
								{
									this.selectThreadNum.Items[4].Selected = true;
									this.selectThreadNum.Items[0].Selected = false;
								}
								else
								{
									if (a2 == "7")
									{
										this.selectThreadNum.Items[5].Selected = true;
										this.selectThreadNum.Items[0].Selected = false;
									}
									else
									{
										if (a2 == "8")
										{
											this.selectThreadNum.Items[6].Selected = true;
											this.selectThreadNum.Items[0].Selected = false;
										}
										else
										{
											if (a2 == "9")
											{
												this.selectThreadNum.Items[7].Selected = true;
												this.selectThreadNum.Items[0].Selected = false;
											}
											else
											{
												if (a2 == "10")
												{
													this.selectThreadNum.Items[8].Selected = true;
													this.selectThreadNum.Items[0].Selected = false;
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	public void InitProductList(int ShopID)
	{
		DataTable dataTable = this.conn.GetDataTable("select * from HLMall_StoreModule where ModuleID=7 and ShopID=" + ShopID);
		if (dataTable != null && dataTable.Rows.Count > 0)
		{
			if (dataTable.Rows[0]["ModuleName"] != DBNull.Value)
			{
				this.PLModuleName.Value = dataTable.Rows[0]["ModuleName"].ToString();
			}
			if (dataTable.Rows[0]["Keyword"] != DBNull.Value)
			{
				this.ProductKeyword.Value = dataTable.Rows[0]["Keyword"].ToString();
			}
			if (dataTable.Rows[0]["ClassID"] != DBNull.Value)
			{
				if (dataTable.Rows[0]["ClassID"].ToString() == "-1")
				{
					this.PLSelectClass.Items[0].Selected = true;
				}
			}
			if (dataTable.Rows[0]["Pricerange1"] != DBNull.Value)
			{
				this.PListprice1.Value = dataTable.Rows[0]["Pricerange1"].ToString();
			}
			if (dataTable.Rows[0]["Pricerange2"] != DBNull.Value)
			{
				this.PListprice2.Value = dataTable.Rows[0]["Pricerange2"].ToString();
			}
			if (dataTable.Rows[0]["ProductType"] != DBNull.Value)
			{
				if (dataTable.Rows[0]["ProductType"].ToString() == "-1")
				{
					this.rdUnlimited.Checked = true;
				}
				else
				{
					if (dataTable.Rows[0]["ProductType"].ToString() == "2")
					{
						this.rdoNew.Checked = true;
						this.rdUnlimited.Checked = false;
					}
					else
					{
						if (dataTable.Rows[0]["ProductType"].ToString() == "1")
						{
							this.rdoOld.Checked = true;
							this.rdUnlimited.Checked = false;
						}
					}
				}
			}
			if (dataTable.Rows[0]["Picturesize"] != DBNull.Value)
			{
				if (dataTable.Rows[0]["Picturesize"].ToString() == "120")
				{
					this.picSize.Items[0].Selected = true;
				}
				else
				{
					if (dataTable.Rows[0]["Picturesize"].ToString() == "160")
					{
						this.picSize.Items[1].Selected = true;
						this.picSize.Items[0].Selected = false;
					}
					else
					{
						if (dataTable.Rows[0]["Picturesize"].ToString() == "220")
						{
							this.picSize.Items[2].Selected = true;
							this.picSize.Items[0].Selected = false;
						}
					}
				}
			}
			if (dataTable.Rows[0]["ShowProductNum"] != DBNull.Value)
			{
				if (dataTable.Rows[0]["ShowProductNum"].ToString() == "3")
				{
					this.itemNum.Items[0].Selected = true;
					this.itemNum.Items[1].Selected = false;
				}
				else
				{
					if (dataTable.Rows[0]["ShowProductNum"].ToString() == "4")
					{
						this.itemNum.Items[1].Selected = true;
					}
					else
					{
						if (dataTable.Rows[0]["ShowProductNum"].ToString() == "6")
						{
							this.itemNum.Items[2].Selected = true;
							this.itemNum.Items[1].Selected = false;
						}
						else
						{
							if (dataTable.Rows[0]["ShowProductNum"].ToString() == "8")
							{
								this.itemNum.Items[3].Selected = true;
								this.itemNum.Items[1].Selected = false;
							}
							else
							{
								if (dataTable.Rows[0]["ShowProductNum"].ToString() == "10")
								{
									this.itemNum.Items[4].Selected = true;
									this.itemNum.Items[1].Selected = false;
								}
								else
								{
									if (dataTable.Rows[0]["ShowProductNum"].ToString() == "12")
									{
										this.itemNum.Items[5].Selected = true;
										this.itemNum.Items[1].Selected = false;
									}
									else
									{
										if (dataTable.Rows[0]["ShowProductNum"].ToString() == "16")
										{
											this.itemNum.Items[6].Selected = true;
											this.itemNum.Items[1].Selected = false;
										}
									}
								}
							}
						}
					}
				}
			}
			if (dataTable.Rows[0]["Sortingway"] != DBNull.Value)
			{
				if (dataTable.Rows[0]["Sortingway"].ToString() == "Humanspirit")
				{
					this.orderType.Items[0].Selected = true;
				}
				else
				{
					if (dataTable.Rows[0]["Sortingway"].ToString() == "Hotkeep")
					{
						this.orderType.Items[1].Selected = true;
						this.orderType.Items[0].Selected = false;
					}
					else
					{
						if (dataTable.Rows[0]["Sortingway"].ToString() == "NewOn")
						{
							this.orderType.Items[2].Selected = true;
							this.orderType.Items[0].Selected = false;
						}
						else
						{
							if (dataTable.Rows[0]["Sortingway"].ToString() == "Lowprice")
							{
								this.orderType.Items[3].Selected = true;
								this.orderType.Items[0].Selected = false;
							}
							else
							{
								if (dataTable.Rows[0]["Sortingway"].ToString() == "Hightprice")
								{
									this.orderType.Items[4].Selected = true;
									this.orderType.Items[0].Selected = false;
								}
							}
						}
					}
				}
			}
		}
	}
}
